<template>
	<view class="content" v-if="showModel">
		<uni-nav-bar fixed left-icon="back" title="用户关联"></uni-nav-bar>
		<!--<button class="scan" type="" @click="scancode">扫一扫</button>-->
		<view class="YmContent">
			<view class="main">
				<view class="tip">
					<image src="/static/image/icon/reg_ok_icon_19.jpg" mode="scaleToFill" border="0" class="icon"></image>
					<text decode="true" class="reg_ok_20">关联成功</text>
					<!--<text class="reg_ok_21">为了保障信息安全,请务必保管好您的身份信息以及账号密码</text>-->
				</view>
				<button v-on:click="btOkclick()" class="btOk">完成</button>
			</view>
		</view>
	</view>
</template>

<script>
    import { mapMutations, mapActions, mapState } from 'vuex'
	export default {
		data() {
			return {
				showModel: false,
				editForm: {
				    staffId: '',
					staffName: '',
					staffPhone: '',
					touristPhone: ''
				}
			}
		},
        computed: {
            ...mapState({
                userInfo: state => state.user.userInfo
            })
        },
		onLoad(option) {
			this.editForm = {
                staffId: option.staffId,
                staffName: option.staffName,
                staffPhone: option.staffPhone,
                touristPhone: this.userInfo.phone
			}
			this.marketGet(this.editForm)
		},
		 methods: {
             btOkclick() {
                uni.navigateBack({delta: 1})
			 },
             marketGet(form) {
                 this.$api.api('market.bind', form).then(res => {
                     if (res.code == 200) {
                         this.showModel = true
					 } else {
                         this.$api.msg(res.message)
                         setTimeout(() => {
                             uni.navigateBack({delta: 1})
                         },800)
					 }
				 }).catch(error => {
                     this.$api.msg(error.message)
					 setTimeout(() => {
                         uni.navigateBack({delta: 1})
					 },800)
				 })
             }
        }

	}
</script>
<style>
	.scan{
		width: 600rpx;
		margin-top: 60rpx;
	}
	.YmContent {height: 100%;width: 100%;}
	.main{white-space:normal;width:749upx;height:100%;padding:0upx;clear:both;float:left;background-color:#f5f6fa; border-radius:0upx;font-size:8upx;}
	.main .tip{white-space:normal;width:749upx;height:384upx;padding:0upx;clear:both;margin-top:0upx;margin-left:0upx;float:left;background-color:#ffffff; border-radius:0upx;font-size:1upx; line-height:1upx;}
	.main .tip .icon{white-space:normal;width:129upx;height:128upx;padding:0upx;clear:both;margin-top:77upx;margin-left:310upx;float:left; border-radius:0upx;font-size:8upx; line-height:128upx;}
	.main .tip .reg_ok_20{white-space:normal;width:150upx;height:38upx;padding:0upx;clear:both;margin-top:25upx;margin-left:299upx;float:left;text-align:center;justify-content:center; border-radius:0upx; color:#646464;font-size:32upx; line-height:38upx;}
	.main .tip .reg_ok_21{white-space:normal;width:570upx;height:77upx;padding:0upx;clear:both;margin-top:20upx;margin-left:90upx;float:left;text-align:center;justify-content:center; border-radius:0upx; color:#c8c8c8;font-size:29upx; line-height:35upx;}
	.main .btOk{white-space:normal;width:703upx;height:93upx;padding:0upx;clear:both;margin-top:63upx;margin-left:24upx;float:left;background-color:#4286f5;text-align:center;justify-content:center; border-radius:10upx; color:#ffffff;font-size:33upx; line-height:93upx;}

</style>
